package com.wy.dao;

import com.wy.bean.HouseholdBean;
import com.wy.model.sys.Households;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface HouseholdsMapper {
    int deleteByPrimaryKey(Integer id);

    void deleteHousehold(@Param("groupId") List<String> groupId);

    int insert(HouseholdBean record);

    int insertSelective(HouseholdBean record);

    Households selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(HouseholdBean record);

    int updateByPrimaryKey(Households record);


    public List<HouseholdBean> householdList(@Param("pageSize") Integer pageSize, @Param("start") Integer start,
                                             @Param("residenceId")Integer residenceId,
                                             @Param("buildingId")Integer buildingId,
                                             @Param("houseId")Integer houseId,
                                             @Param("householdName") String householdName,
                                             @Param("authStatus") String authStatus,
                                             @Param("mobile") String mobile,
                                             @Param("plateNum") String plateNum,
                                             @Param("rids")List<String> rids);


    public Integer householdSize(@Param("pageSize") Integer pageSize, @Param("start") Integer start,
                                 @Param("residenceId")Integer residenceId,
                                 @Param("buildingId")Integer buildingId,
                                 @Param("houseId")Integer houseId,
                                 @Param("householdName") String householdName,
                                 @Param("authStatus") String authStatus,
                                 @Param("mobile") String mobile,
                                 @Param("plateNum") String plateNum,
                                 @Param("rids") List<String> rids);

    List<HouseholdBean> getHouseHoldByUserId(Integer uid);

    void authHousehoulds(@Param("groupId") List<String> groupId);

    /**
     * 获取所有住户
     */
    List<HouseholdBean> getHouseholdList(@Param("rids") List<String> rids);

    Households getHouseholdByUidAndHid(Integer uid,Integer houseId);

    /**
     * 导入excel
     * @param list
     * @return
     */
    int insertBatch(List<HouseholdBean> list);

    /**
     * 直接保存房屋id
     * @param list
     * @return
     */
    int insertBatch1(List<HouseholdBean> list);

    List<HouseholdBean> getHouseholdByHidNotCurrentId(@Param("houseId")Integer houseId,@Param("currentHouseholdId")Integer currentHouseholdId);

    List<HouseholdBean> getHouseholdByMobile(@Param("mobile")String mobile);

    List<Households> getHouseholdByIds(@Param("ids")List<String> ids);

    List<HouseholdBean> getHouseholdByHid(@Param("hid")Integer hid);

    List<HouseholdBean> getHouseholdByHidCreNo(@Param("hid")Integer houseId, @Param("credenceNo")String credentialNo);
}